package com.galaxy.payment.domain.bo;

import com.galaxy.common.core.validate.AddGroup;
import com.galaxy.common.core.validate.EditGroup;
import com.galaxy.common.mybatis.core.domain.BaseEntity;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * 资金流水记录业务对象
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class AccountFlowBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = {EditGroup.class})
    private Long id;

    /**
     * 用户ID
     */
    @NotNull(message = "用户ID不能为空", groups = {AddGroup.class})
    private Long userId;

    /**
     * 关联订单号
     */
    @NotBlank(message = "订单号不能为空", groups = {AddGroup.class})
    private String orderNo;

    /**
     * 流水类型(1:充值,2:消费,3:退款,4:积分兑换)
     */
    @NotNull(message = "流水类型不能为空", groups = {AddGroup.class})
    private Integer flowType;

    /**
     * 金额
     */
    @NotNull(message = "金额不能为空", groups = {AddGroup.class})
    private BigDecimal amount;

    /**
     * 变动后余额
     */
    @NotNull(message = "变动后余额不能为空", groups = {AddGroup.class})
    private BigDecimal balance;

    /**
     * 描述
     */
    private String description;
}
